package jun.learn.ognl;

import ognl.Ognl;

public class OgnlTest {
	public static void main(String[] args) throws Exception {
		test02();
	}
	
	public static void test01() throws Exception{
		User root = new User();
		root.setUsername("xujun");
		String username = (String)Ognl.getValue("username", root);
		System.out.println(username);
	}
	
	public static void test02() throws Exception{
		User root = new User();
		root.setUsername("xujun");
		Group group = new Group("pda", new Organization("123"));
		root.setGroup(group);
		String orgId = (String)Ognl.getValue("#root.group.org.orgId", root);
		System.out.println(orgId);
		Ognl.getValue("@System@out.println(\"456\")", new Object());
	}
}
